
package std.convert


@!APILevel[
    since: "22"
]
public interface Formattable {
    @!APILevel[
        since: "22"
    ]
    func format(fmt: String): String
}

extend Int64 <: Formattable {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func format(fmt: String): String
}

extend Int32 <: Formattable {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func format(fmt: String): String
}

extend Int16 <: Formattable {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func format(fmt: String): String
}

extend Int8 <: Formattable {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func format(fmt: String): String
}

extend UInt64 <: Formattable {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func format(fmt: String): String
}

extend UInt32 <: Formattable {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func format(fmt: String): String
}

extend UInt16 <: Formattable {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func format(fmt: String): String
}

extend UInt8 <: Formattable {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func format(fmt: String): String
}

extend Float64 <: Formattable {
    /**
    * @throws IllegalMemoryException
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func format(fmt: String): String
}

extend Float32 <: Formattable {
    /**
    * @throws IllegalMemoryException
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func format(fmt: String): String
}

extend Float16 <: Formattable {
    /**
    * @throws IllegalMemoryException
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func format(fmt: String): String
}

extend Rune <: Formattable {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func format(fmt: String): String
}

@!APILevel[
    since: "22"
]
public interface Parsable<T> {
    @!APILevel[
        since: "22"
    ]
    static func parse(value: String): T
    
    @!APILevel[
        since: "22"
    ]
    static func tryParse(value: String): Option<T>
}

@!APILevel[
    since: "22"
]
public interface RadixConvertible<T> {
    @!APILevel[
        since: "22"
    ]
    static func parse(value: String, radix!: Int64): T
    
    @!APILevel[
        since: "22"
    ]
    static func tryParse(value: String, radix!: Int64): Option<T>
    
    @!APILevel[
        since: "22"
    ]
    func toString(radix!: Int64): String
}

extend Int8 <: Parsable<Int8> {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func parse(data: String): Int8
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func tryParse(data: String): Option<Int8>
}

extend Int8 <: RadixConvertible<Int8> {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func parse(value: String, radix!: Int64): Int8
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func tryParse(value: String, radix!: Int64): Option<Int8>
    
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func toString(radix!: Int64): String
}

extend UInt8 <: Parsable<UInt8> {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func parse(data: String): UInt8
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func tryParse(data: String): Option<UInt8>
}

extend UInt8 <: RadixConvertible<UInt8> {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func parse(value: String, radix!: Int64): UInt8
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func tryParse(value: String, radix!: Int64): Option<UInt8>
    
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func toString(radix!: Int64): String
}

extend Int16 <: Parsable<Int16> {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func parse(data: String): Int16
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func tryParse(data: String): Option<Int16>
}

extend Int16 <: RadixConvertible<Int16> {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func parse(value: String, radix!: Int64): Int16
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func tryParse(value: String, radix!: Int64): Option<Int16>
    
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func toString(radix!: Int64): String
}

extend UInt16 <: Parsable<UInt16> {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func parse(data: String): UInt16
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func tryParse(data: String): Option<UInt16>
}

extend UInt16 <: RadixConvertible<UInt16> {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func parse(value: String, radix!: Int64): UInt16
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func tryParse(value: String, radix!: Int64): Option<UInt16>
    
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func toString(radix!: Int64): String
}

extend Int32 <: Parsable<Int32> {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func parse(data: String): Int32
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func tryParse(data: String): Option<Int32>
}

extend Int32 <: RadixConvertible<Int32> {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func parse(value: String, radix!: Int64): Int32
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func tryParse(value: String, radix!: Int64): Option<Int32>
    
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func toString(radix!: Int64): String
}

extend UInt32 <: Parsable<UInt32> {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func parse(data: String): UInt32
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func tryParse(data: String): Option<UInt32>
}

extend UInt32 <: RadixConvertible<UInt32> {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func parse(value: String, radix!: Int64): UInt32
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func tryParse(value: String, radix!: Int64): Option<UInt32>
    
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func toString(radix!: Int64): String
}

extend Int64 <: Parsable<Int64> {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func parse(data: String): Int64
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func tryParse(data: String): Option<Int64>
}

extend Int64 <: RadixConvertible<Int64> {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func parse(value: String, radix!: Int64): Int64
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func tryParse(value: String, radix!: Int64): Option<Int64>
    
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func toString(radix!: Int64): String
}

extend UInt64 <: Parsable<UInt64> {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func parse(data: String): UInt64
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    */
    @OverflowWrapping
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func tryParse(data: String): Option<UInt64>
}

extend UInt64 <: RadixConvertible<UInt64> {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func parse(value: String, radix!: Int64): UInt64
    
    /**
    * @throws IllegalArgumentException
    * @throws IndexOutOfBoundsException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func tryParse(value: String, radix!: Int64): Option<UInt64>
    
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public func toString(radix!: Int64): String
}

extend Float16 <: FloatParsable<Float16> {
    @!APILevel[
        since: "22"
    ]
    public static func fromFloat64(n: Float64): Float16
}

extend Float32 <: FloatParsable<Float32> {
    @!APILevel[
        since: "22"
    ]
    public static func fromFloat64(n: Float64): Float32
}

extend Float64 <: FloatParsable<Float64> {
    @!APILevel[
        since: "22"
    ]
    public static func fromFloat64(n: Float64): Float64
}

extend Float16 <: Parsable<Float16> {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalMemoryException
    * @throws IllegalArgumentException
    */
    @Frozen
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func parse(data: String): Float16
    
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    * @throws IllegalMemoryException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func tryParse(data: String): Option<Float16>
}

extend Float32 <: Parsable<Float32> {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalMemoryException
    * @throws IllegalArgumentException
    */
    @Frozen
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func parse(data: String): Float32
    
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    * @throws IllegalMemoryException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func tryParse(data: String): Option<Float32>
}

extend Float64 <: Parsable<Float64> {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalMemoryException
    * @throws IllegalArgumentException
    */
    @Frozen
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func parse(data: String): Float64
    
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    * @throws IllegalMemoryException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func tryParse(data: String): Option<Float64>
}

extend Rune <: Parsable<Rune> {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func parse(data: String): Rune
    
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func tryParse(data: String): Option<Rune>
}

extend Bool <: Parsable<Bool> {
    /**
    * @throws IndexOutOfBoundsException
    * @throws IllegalArgumentException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func parse(data: String): Bool
    
    /**
    * @throws IndexOutOfBoundsException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public static func tryParse(data: String): Option<Bool>
}

